<template>
<input readonly="readonly" v-model="value" :placeholder="placeholder" v-on:input="$emit('input', $event.target.value)" />
</template>
<script>
import Vue from 'vue';

/**
 * <ab-serial-no v-model="data.lsh.lsh" :ab-permission="permission.lsh.lshcs.lsh" serial-no="dayNo"></ab-serial-no>
 */
export default {
	props: ['value',"serialNo","abPermission","placeholder"],
  	methods: {
    
  	},
  	data :function () {
	    return {
	    }
	},
 	mounted : function(){
 		//无权限或者已经有值了，则不需要处理
		if(this.abPermission ==="n"||this.abPermission ==="r"||this.value){
			return;
		}
 		
		var url = Vue.__ctx + "/sys/serialNo/getNextIdByAlias";
    	var post = Vue.baseService.postForm(url,{
    		alias:this.serialNo
		});
    	var that = this;
    	Vue.tools.getResultData(post,function(data){
    		that.$emit('input', data);
    	});
 	}
}
</script>
